package com.jlkf.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jlkf.dao.TblOrderMapper;
import com.jlkf.dao.TblRelationMapper;
import com.jlkf.dao.TblRoleMapper;
import com.jlkf.dao.TblSysUserMapper;
import com.jlkf.pojo.TblOrder;
import com.jlkf.pojo.TblRelation;
import com.jlkf.pojo.TblRole;
import com.jlkf.pojo.TblSysUser;
import com.jlkf.service.SysUserService;
import com.platform.server.response.response.pojo.ReturnData;
import com.platform.server.util.StringTools;

@Service
public class SysUserServiceImpl implements SysUserService {
	@Autowired
	private TblSysUserMapper tblSysUserMapper;
	@Autowired
	private TblRoleMapper tblRoleMapper;
	@Autowired
	private TblRelationMapper tblRelationMapper;
	
	@Override
	public TblSysUser loginUser(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.loginUser(map);
	}

	@Override
	public List<TblSysUser> getSysUserList(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.selectSysUserList(map);
	}

	@Override
	public int insertSysUser(TblSysUser sysUser) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.insertSelective(sysUser);
	}

	@Override
	public int updateSysUser(TblSysUser sysUser) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.updateByPrimaryKeySelective(sysUser);
	}

	@Override
	public TblSysUser getSysUserDetail(Integer gId) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.selectByPrimaryKey(gId);
	}

	@Override
	public int delete(List<String> list) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.deleteList(list);
	}

	@Override
	public int updatePwd(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.updatePwd(map);
	}

	@Override
	public List<TblRole> selectRoleList(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return tblRoleMapper.selectListByCondition(map);
	}

	@Override
	public int insertRole(TblRole role) {
		// TODO Auto-generated method stub
		return tblRoleMapper.insertSelective(role);
	}

	@Override
	public int updateRole(TblRole role) {
		// TODO Auto-generated method stub
		return tblRoleMapper.updateByPrimaryKeySelective(role);
	}

	@Override
	public int deleteRole(Integer gId) {
		// TODO Auto-generated method stub
		return tblRoleMapper.deleteByPrimaryKey(gId);
	}

	@Override
	public TblRole getRoleDetail(Integer gId) {
		// TODO Auto-generated method stub
		return tblRoleMapper.selectByPrimaryKey(gId);
	}

	@Override
	public Integer isBandRole(Integer rId) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.isBandRole(rId);
	}

	@Override
	public List<TblSysUser> getAgentList() {
		// TODO Auto-generated method stub
		return tblSysUserMapper.selectAgentList();
	}

	@Override
	public int updateStatus(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return tblSysUserMapper.updateStatus(map);
	}

	@Override
	public List<TblRelation> selectRelationList(Integer uId) {
		// TODO Auto-generated method stub
		return tblRelationMapper.selectBySuperior(uId);
	}
}
